package com.addzero.web.ui.hooks.tree

import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp

fun getMockkTree(): List<TreeNode<String>> = listOf(
    TreeNode(
        id = "1",
        label = "我的文档",
        data = "docs",
        type = NodeTypes.FOLDER,
        children = listOf(
            TreeNode(
                id = "1-1",
                label = "技术文档",
                data = "tech",
                type = NodeTypes.FOLDER,
                children = listOf(
                    TreeNode(id = "1-1-1", label = "React学习笔记", data = "react", type = NodeTypes.DOCUMENT),
                    TreeNode(id = "1-1-2", label = "Vue教程", data = "vue", type = NodeTypes.DOCUMENT),
                    TreeNode(id = "1-1-3", label = "架构设计图", data = "architecture", type = NodeTypes.IMAGE)
                )
            ),
            TreeNode(
                id = "1-2",
                label = "多媒体资源",
                data = "media",
                type = NodeTypes.FOLDER,
                children = listOf(
                    TreeNode(id = "1-2-1", label = "产品演示视频", data = "demo", type = NodeTypes.VIDEO),
                    TreeNode(id = "1-2-2", label = "会议录音", data = "meeting", type = NodeTypes.AUDIO),
                    TreeNode(id = "1-2-3", label = "项目资源链接", data = "resources", type = NodeTypes.LINK)
                )
            )
        )
    ),
    TreeNode(
        id = "2",
        label = "项目管理",
        data = "project",
        type = NodeTypes.FOLDER,
        children = listOf(
            TreeNode(id = "2-1", label = "待办任务", data = "todo", type = NodeTypes.TASK),
            TreeNode(id = "2-2", label = "重要标签", data = "important", type = NodeTypes.TAG),
            // 使用自定义渲染函数的节点
            TreeNode(
                id = "2-3",
                label = "自定义节点",
                data = "custom",
                type = NodeTypes.DEFAULT,
                customRender = { node ->
                    Text(
                        text = "⭐ ${node.label} (自定义渲染)",
                        color = Color.Blue,
                        fontWeight = FontWeight.Bold,
                        modifier = Modifier.padding(start = 8.dp)
                    )
                }
            )
        )
    )
)
